package com.xiaoma.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaoma.dao.CategoryDao;
import com.xiaoma.entity.Category;
import com.xiaoma.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: xiaoma
 * @Date: 2021/7/9 10:03
 * @description:
 */
@Service
@Slf4j
public class CategoryServiceImpl extends ServiceImpl<CategoryDao, Category>  implements CategoryService {

    @Override
    @Cacheable(value = {"category"},key = "#root.methodName",sync = true)
    public List<Category> queryAll() {
        return baseMapper.selectList(null);
    }
}
